Skip to content

Fix crash when running codeman with no args under bash nounset#3

Open
shabo wants to merge 8 commits into
mainfrom
shabo/fix-nounset-empty-parsed-args
Open

Fix crash when running codeman with no args under bash nounset#3
shabo wants to merge 8 commits into
mainfrom
shabo/fix-nounset-empty-parsed-args

Conversation

@shabo

@shabo shabo commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes macOS default Bash (3.2) compatibility issues and improves Discord/Slack notifications so they work in real interactive usage.

What changed

  • Fixed set -u crash when running codeman with no args (empty-array expansion).
  • Replaced mapfile usage (not available in Bash 3.2) with portable while read loops.
  • Added bats regression tests plus CI matrix (Ubuntu + macOS) and expanded ShellCheck coverage.
  • Added per-assistant-message notifications (opt-in via CODEMAN_NOTIFY_ON=...,message).
  • Session monitoring now respects CODEX_HOME (defaults to ~/.codex).
  • Bumped version to v0.1.3.

Why

  • Bash 3.2 treats expanding an empty array under set -u as an error (unbound variable).
  • Bash 3.2 does not implement mapfile, so codeman l3 ... could fail.
  • The original notification logic only emitted on task_complete / approval waits; interactive usage needs message-level pings.

ASCII flow

+-------------------+
| start (set -euo) |
+-------------------+
|
v
+-------------------+
| parse args/flags |
+-------------------+
|
v
+-------------------------------+
| run codex + tail session log |
| (from $CODEX_HOME/sessions) |
+-------------------------------+
|
v
+-----------------------------------------------+
| on new session lines: |
| - wait: denial markers -> Discord/Slack ping |
| - message: agent_message -> Discord/Slack ping |
| - complete: task_complete -> Discord/Slack ping|
+-----------------------------------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant